const db = require('better-sqlite3')('data.db');


const row = db.prepare('SELECT * FROM user WHERE id=?').get(1);
console.log(row.user_name);

const updateRow = db.prepare('update user set user_name = ? where id = ?');
let updateResult = updateRow.run('tom', 1);
console.log(updateResult);
console.log(updateResult.changes);


// const row2 = db.prepare('SELECT * FROM users WHERE id=?').get(userId);
// console.log(row2.firstName, row2.lastName, row2.email);